package com.koomii.redismq;

import java.io.Serializable;

/**
 * 消息实体，消息有KEY 和content两部分组成， 注意：content必须实现序列化接口
 * 
 * @author dingxiangyong 2016年7月28日 下午1:40:32
 */
public class Message implements Serializable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = -8657613687306891080L;
	
	/**
	 * 目标队列
	 */
	private String destination;

	/**
	 * 消息具体内容
	 */
	private String content;

	/**
	 * 执行失败次数
	 */
	private Integer failTimes;

	public Message(String destination, String content)
	{
		super();
		this.destination = destination;
		this.content = content;
		this.failTimes = new Integer(0);
	}

	public Message()
	{
		super();
	}


	public String getContent()
	{
		return content;
	}

	public void setContent(String content)
	{
		this.content = content;
	}

	public Integer getFailTimes()
	{
		return failTimes;
	}

	public void setFailTimes(Integer failTimes)
	{
		this.failTimes = failTimes;
	}

	@Override
	public String toString()
	{
		StringBuilder builder = new StringBuilder();
		builder.append("Message [destination=");
		builder.append(destination);
		builder.append(", content=");
		builder.append(content);
		builder.append(", failTimes=");
		builder.append(failTimes);
		builder.append("]");
		return builder.toString();
	}

	public String getDestination() {
		return destination;
	}

	public void setDestination(String destination) {
		this.destination = destination;
	}

}
